package main

import "fmt"

var lines = 9
func main() {
	//printRectangle()
	//printRightTraiangleLB()
	//printRightTraiangleLT()
	//printRightTraiangleRB()
	//printRightTraiangleRT()
	//printEqualTriangle()
	multiple99()
}
//1、 print Rectangle
func printRectangle()  {
	fmt.Println("\n打印矩形")
	for i:=1;i<=lines;i++{
		for j:=1;j<=lines;j++{
			fmt.Print("* ")
		}
		fmt.Println()
	}
}

//2、 printRightTraiangleLB
func printRightTraiangleLB()  {
	fmt.Println("\n打印左下直角三角形")
	for i:=1;i<=lines;i++{
		for j:=1;j<=i;j++{
			fmt.Print("* ")
		}
		fmt.Println()
	}
}

//3、 printRightTraiangleLT
func printRightTraiangleLT()  {
	fmt.Println("\n打印左上直角三角形")
	for i:=1;i<=lines;i++{
		for j:=lines;j>=i;j--{
			fmt.Print("* ")
		}
		fmt.Println()
	}
}

//4、 printRightTraiangleRB
func printRightTraiangleRB()  {
	fmt.Println("\n打印右下直角三角形")
	for i:=1;i<=lines;i++{
		for m:=lines;m>=i ;m--  {
			fmt.Print("  ")
		}
		for j:=1;j<=i;j++{
			fmt.Print("* ")
		}
		fmt.Println()
	}
}

//5、 printRightTraiangleRT
func printRightTraiangleRT()  {
	fmt.Println("\n打印右上直角三角形")
	for i:=1;i<=lines;i++{
		for m:=1;m<=i ;m++  {
			fmt.Print("  ")
		}
		for j:=lines;j>=i;j--{
			fmt.Print("* ")
		}
		fmt.Println()
	}
}

//6、 printEqualTriangle
func printEqualTriangle()  {
	fmt.Println("\n打印等腰三角形")
	for i:=1;i<=lines ;i++  {
		for m:=lines;m>=i;m--{
			fmt.Print("  ")
		}
		for j:=1;j<=2*i-1 ;j++  {
			fmt.Print("* ")
		}
		fmt.Println()
	}
}

//7、 
func multiple99()  {
	fmt.Println("打印99乘法表")
	for i:=1;i<=lines ;i++  {
		for j:=1;j<=i;j++  {
			fmt.Printf("%d*%d=%d ",j,i,i*j)
		}
		fmt.Println()
	}
}

